package com.jia.lidao.network.http.request.impl;

import android.support.design.widget.TabLayout;

import com.jia.lidao.Constans;
import com.jia.lidao.network.http.request.AbstractRequest;
import com.lidroid.xutils.http.client.HttpRequest;

import org.apache.http.Header;

import java.lang.reflect.Type;
import java.util.List;

/**
 * Created by jia on 17/12/23.
 */

public class DealWithOrderRequest extends AbstractRequest {

    private int role;

    private int status;


    private int id;


    public DealWithOrderRequest(int role,int status,int id){
        this.role=role;
        this.status= status;
        this.id=id;
    }

    @Override
    public String getUrl() {
        //status：-2已关闭 -1已驳回 1待付款 2待审核 3待发货 4待收货 5待评价 6已完成 ,
        if(role== Constans.ORDERRECEIVE){
            switch (status){
                case 3:
                    return Constans.BASEURL+"/orders/"+id+"/remind/delivery";
                case 4:
                    return Constans.BASEURL+"/orders/"+id+"/receipt";
                case 7:
                    return Constans.BASEURL+"/orders/"+id+"/cancel";
                case 8:
                    return Constans.BASEURL+"/orders/"+id+"/delete";
            }
        }else {
            switch (status){
                case 1:
                    return Constans.BASEURL+"/orders/"+id+"/remind/pay";
                case 4:
                    return Constans.BASEURL+"/orders/"+id+"/remind/receipt";

            }
        }
        return null;
    }

    @Override
    public void initRequestParams() {

    }

    @Override
    public List<Header> getHeaders() {
        return null;
    }

    @Override
    public Type getResultType() {
        return Void.class;
    }

}
